/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DEVMON_ROOT_TOPO_OBJECT_H
#define DEVMON_ROOT_TOPO_OBJECT_H

#include <mc/engine.h>

#include "discovery/root_interface.h"

namespace devmon {

class root_topo_object;
using root_topo_object_ptr = mc::shared_ptr<root_topo_object>;

class root_topo_object : public mc::engine::object<root_topo_object> {
public:
    MC_OBJECT(root_topo_object, "DevTopology", "/bmc/dev/topology", (root_interface))

    root_topo_object() = default;

    static root_topo_object_ptr create_root_topo_object(mc::engine::service* service) {
        auto root_topo_object_ptr = mc::make_shared<root_topo_object>();
        root_topo_object_ptr->set_object_name("DevTopology");

        service->register_object(root_topo_object_ptr);
        ilog("root topo object created");
        return root_topo_object_ptr;
    }

private:
    root_interface m_root_interface;
};

} // namespace devmon

#endif // DEVMON_ROOT_OBJECT_H